package xiecheng;

import java.util.Scanner;

/**
 * @author Hang
 * @date 2022/8/30
 * @project AutumnOffer
 * @description
 **/
public class Solution4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i=0;i<n;i++){
            arr[i] = sc.nextInt();
        }
        boolean flag = false;
        int gap = 0;
        for(int i=1;i<n;i++){
            if(arr[i] - arr[i-1] > gap && flag == true){
                gap = arr[i] - arr[i-1];
            }else {
                if(i == 1){
                    gap = gap;
                }else if(i >= 2){
                    gap = (arr[i] - arr[i-2])/2;
                }else {
                    gap = gap;
                }
            }
        }
        System.out.println(gap);
    }
}
